﻿Public Class clsProdSpec
    ' 查询规格信息
    Public Function selectAllbySpecId(_prod_spec_id As String) As DataTable
        Dim szSql As String = ""
        szSql &= "SELECT prod_spec_id || '  (' || prod_spec_name  || ')' as mst_name ,* FROM sf.t_prod_spec "
        szSql &= " WHERE factory_id = ? and  prod_spec_id = ?"
        Return DBacs.ExecuteSql(szSql, -1, "TS", _prod_spec_id)
    End Function

    Public Function getSpecANDName(prod_spec As String) As DataTable
        Dim szSql As String = ""
        szSql &= "SELECT prod_spec_id || '  (' || prod_spec_name  || ')'as mst_name ,prod_spec_id,prod_spec,gjb_layer_num  FROM sf.t_prod_spec "
        szSql &= " where factory_id = ? and gjb_type = ? and prod_spec_name<>'' order by prod_spec_id"
        Dim dt As DataTable = DBacs.ExecuteSql(szSql, -1, "TS", prod_spec)
        Return dt
    End Function

    Public Function getSpecNameByID(_prod_spec_id As String) As String
        Dim rtn As String = ""
        Dim szSql As String = ""
        szSql &= "SELECT  prod_spec_name  FROM sf.t_prod_spec "
        szSql &= " where  factory_id =? and prod_spec_id=? order by prod_spec_id"

        Dim dt As DataTable = DBacs.ExecuteSql(szSql, -1, "TS", _prod_spec_id)
        If IsNothing(dt) Then
            rtn = ""
        Else
            rtn = dt.Rows(0)("prod_spec_name").ToString()
        End If
        Return rtn
    End Function
    Public Function getFLBAllList() As DataTable
        Dim szSql As String = String.Empty
        szSql &= "SELECT * FROM sf.t_mst_flb "
        szSql &= " WHERE 1 = 1 and validity = ?"
        Dim dt As DataTable = DBacs.ExecuteSql(szSql, -1, "1")
        Return dt
    End Function

    Public Function getGJBAllList() As DataTable
        Dim szSql As String = String.Empty
        szSql &= "SELECT * FROM sf.t_mst_gjb "
        szSql &= " WHERE 1 = 1 and validity = ?"
        Dim dt As DataTable = DBacs.ExecuteSql(szSql, -1, "1")
        Return dt
    End Function

End Class
